<ui:composition template="/WEB-INF/templates/splitted.xhtml"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="title">Registrazione</ui:define>
	
	<ui:define name="sideNav">
    	<ui:include src="/WEB-INF/templates/login.xhtml" />		    	
	</ui:define>	

	<ui:define name="content">
		<p:panel header="Registrazione Utente">
			<h:form>
				<h:panelGrid columns="3" id="regGrid">
					<h:outputLabel value="Email:  " />
					<p:inputText id="email" value="#{registerBean.user.email}" />
					<p:message for="email" />
	
					<h:outputLabel value="Nome:  " />
					<p:inputText id="name" value="#{registerBean.user.name}" />
					<p:message for="name" />
	
					<h:outputLabel value="Cognome:  " />
					<p:inputText id="surname" value="#{registerBean.user.surname}" />
					<p:message for="surname" />
			
					<h:outputLabel value="Indirizzo:  " />
					<p:inputText id="address" value="#{registerBean.user.address}" />
					<p:message for="address" />
	
					<h:outputLabel value="Password:  " />
					<p:password id="password" value="#{registerBean.user.password}"
						feedback="true" match="pwd2" label="Password"/>
					<p:message for="password" />
	
					<h:outputLabel value="Conferma Password:  " />
					<p:password id="pwd2" label="Confirm Password" value="#{registerBean.user.password}"/>
				</h:panelGrid>
				<p:commandButton value="Registrati" update="regGrid"
					action="#{registerBean.register()}" />
			</h:form>
		</p:panel>
	</ui:define>
</ui:composition>